﻿<Window x:Class="Sample.TradesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:EcngTradingXaml="clr-namespace:StockSharp.Xaml;assembly=StockSharp.Xaml"
	x:Name="tradesWindow"
    Title="Сделки" Height="284" Width="544">
	<Window.Resources>
		<EcngTradingXaml:BackgroundConvertor x:Key="myConverter" />

		<Style x:Key="myItemStyle" TargetType="{x:Type ListViewItem}">
			<Setter Property="Background">
				<Setter.Value>
					<Binding RelativeSource="{RelativeSource Self}" Converter="{StaticResource myConverter}"/>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
	<Grid>
        <ListView x:Name="TradesDetails" Grid.Column="0" Grid.Row="0" ItemContainerStyle="{StaticResource myItemStyle}" ItemsSource="{Binding ElementName=tradesWindow, Path=Trades}">
			<ListView.View>
				<GridView>
					<GridViewColumn Width="100" Header="Номер" DisplayMemberBinding="{Binding Path=Id}" />
					<GridViewColumn Width="120" Header="Время" DisplayMemberBinding="{Binding Path=Time}" />
					<GridViewColumn Width="100" Header="Цена" DisplayMemberBinding="{Binding Path=Price}" />
					<GridViewColumn Width="100" Header="Кол-во" DisplayMemberBinding="{Binding Path=Volume}" />
					<GridViewColumn Width="100" Header="Инструмент" DisplayMemberBinding="{Binding Path=Security.Code}" />
				</GridView>
			</ListView.View>
		</ListView>
    </Grid>
</Window>
